import { IsBoolean, IsEnum, IsNumber, IsOptional, Min } from 'class-validator';
import { PaymentMethodType } from '../../entities/payment.entity';

export class UpdatePaymentDto {
  @IsNumber()
  @IsOptional()
  orderID?: number;

  @IsNumber()
  @Min(0, { message: '支付金额不能为负数' })
  @IsOptional()
  amount?: number;

  @IsEnum(['线下到店支付', '微信支付', '支付宝支付'], {
    message: '支付方式必须是线下到店支付、微信支付或支付宝支付',
  })
  @IsOptional()
  paymentMethod?: PaymentMethodType;

  @IsBoolean()
  @IsOptional()
  isPaid?: boolean;
}
